package com.victor.bookretail.service.point;

import java.util.Map;
import java.util.concurrent.ConcurrentHashMap;

public class PointCalculationManager {

    //key: user type, value:point calculation strategy
    private static Map<String, PointCalculation> POINT_CAL_MAP = new ConcurrentHashMap<>();

    public static PointCalculation getPointCalculationByUserType(String userType) {
        return POINT_CAL_MAP.get(userType);
    }

    public static void registerPointCalculation(String userType, PointCalculation pointCalculation) {
        POINT_CAL_MAP.put(userType, pointCalculation);
    }
}
